<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>编辑用户</title>
  <style>
    body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
    .container { width: 400px; margin: 50px auto; padding: 20px; border: 1px solid #ddd; border-radius: 5px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
    h2 { color: #2c3e50; text-align: center; }
    .form-group { margin-bottom: 15px; }
    label { display: block; margin-bottom: 5px; font-weight: 600; }
    input[type="text"], input[type="password"] {
      width: 100%;
      padding: 10px;
      border: 1px solid #ddd;
      border-radius: 4px;
      box-sizing: border-box;
    }
    .btn {
      background-color: #f39c12;
      color: white;
      border: none;
      padding: 10px 15px;
      border-radius: 4px;
      cursor: pointer;
      width: 100%;
      font-size: 16px;
    }
    .btn:hover { background-color: #e67e22; }
    .back-link {
      display: block;
      text-align: center;
      margin-top: 15px;
      color: #3498db;
      text-decoration: none;
    }
  </style>
</head>
<body>
<div class="container">
  <h2>编辑用户</h2>
  <form action="${pageContext.request.contextPath}/user/edit" method="post">
    <input type="hidden" name="id" value="${user.id}">

    <div class="form-group">
      <label for="username">用户名:</label>
      <input type="text" id="username" name="username" value="${user.username}" required>
    </div>

    <div class="form-group">
      <label for="password">密码:</label>
      <input type="password" id="password" name="password" value="${user.password}" required>
    </div>

    <div class="form-group">
      <label for="email">邮箱:</label>
      <input type="text" id="email" name="email" value="${user.email}" required>
    </div>

    <button type="submit" class="btn">更新用户</button>
    <a href="${pageContext.request.contextPath}/user/list" class="back-link">返回用户列表</a>
  </form>
</div>
</body>
</html>